<template>
  <div class="g-button" :class="{ margin: margin }">
    <van-button
      :type="type"
      :block="block"
      :disabled="disabled"
      :plain="plain"
      :hairline="hairline"
      :loading="loading"
      @click="onClick"
    >
      <slot></slot>
    </van-button>
  </div>
</template>

<script>
export default {
  name: "g-button",
  props: {
    type: {
      type: String,
      default: "info"
    },
    block: {
      type: Boolean,
      default: true
    },
    plain: {
      type: Boolean,
      default: false
    },
    hairline: {
      type: Boolean,
      default: false
    },
    margin: {
      type: Boolean,
      default: true
    },
    disabled: {
      type: Boolean,
      default: false
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    onClick() {
      this.$emit("click");
    }
  }
};
</script>

<style lang="less" scoped>
.g-button {
}

.margin {
  box-sizing: border-box;
  margin: 35px;
}
</style>
